package io.wdb.modules.activity.wxapp.entity;

import java.io.Serializable;
import java.util.Date;

import io.wdb.common.utils.CommonUtil;

public class HdLotteryActivityConvertInfoEntity implements Serializable {

	/**
	  SELECT t2.nickname nickname,t2.avatar avatar,t3.lottery_name
	  lotteryName,t1.create_time createTime FROM hd_lottery_user_info t1,hd_user
	  t2,hd_lottery_activity t3 WHERE t1.hd_user_id = t2.id AND
	  t1.hd_lottery_activity_id = t3.id AND t1.lottery_status >= 0 ORDER BY
	  t1.create_time desc limit 0,1;
	 */
	private static final long serialVersionUID = 5310023754530556157L;
	
	private String avatar;
	private String lotteryName;
	private String lotteryContent;
	private Date createTime;
	private String nickname;
	private String mobile;
	
	public String getLotteryContent() {
		return lotteryContent;
	}
	public void setLotteryContent(String lotteryContent) {
		this.lotteryContent = lotteryContent;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public String getAvatar() {
		return avatar;
	}
	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}
	public String getLotteryName() {
		return lotteryName;
	}
	public void setLotteryName(String lotteryName) {
		this.lotteryName = lotteryName;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public String getNickname() {
		if("匿名用户".equals(nickname) && !CommonUtil.isEmpty(mobile)) {
			if(mobile.length() > 10) {
				return mobile.substring(0, 3) + "****" + mobile.substring(7);
			}
		}
		return nickname;
	}
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	
}
